<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@include file="../base.jsp"%> 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>    
<link href="../css/main.css" rel="stylesheet" type="text/css" >
<link rel="stylesheet" type="text/css" href="../../js/jquery/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../../js/jquery/easyui/themes/icon.css">
<script type="text/javascript" src="../../js/jquery-1.8.0.min.js"></script>
<script src="../../js/jquery/easyui/jquery.easyui.min.js"></script>
<script src="../../js/jquery/easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../../js/jquery.select.js"></script>
<script type="text/javascript">
var datagrid={
    datagridId:"list",
    datagridUrl:"systemMagAjax_paginationRiskPayOrderBySearch.action",
    datagridObj:{
        /*title:"查询列表",*/
        nowrap:true,
        autoRowHeight:false,
        fit:true,
        columns:[
            [
          		{field:'id',title:'ID'},
             	{field:'riskTypeStr',title:'风控类型'},
                {field:'orderNoPay',title:'网关支付订单号'},
                {field:'baseTradeTypeInfoName',title:'交易类型'},
                {field:'basePayTypeInfoName',title:'支付方式'},
                {field:'payAccountName',title:'支付账户名'},
                {field:'rcvAccountName',title:'接收账户名'},
                {field:'customerAccountName',title:'客户账户名'},
                {field:'moneyPayYuan',title:'支付金额'},
                {field:'reason',title:'原因'},
                {field:'createDateStr',title:'创建日期'},
                {field:'lastUpdateDateStr',title:'处理日期'},
                {field:'lastUpdateOper',title:'处理人'},
                {field:'dealMethod',title:'处理方法'},
                {field:'dealResult',title:'处理结果'},
                {field:'remark',title:'备注'}
            ]
        ],
        rownumbers:true,
		frozenColumns:[[
		                {field:'cb',checkbox:true}/*,
		                {title:'ID',field:'id',width:80,sortable:true}
		                */
					]],
        toolbar:[
                   {
                     id:'addId',
                     text:'处理',
                     iconCls:'icon-add',
                     handler:function(){
                    	 addRiskBlackList();
                     }
                  }
                 ]
    },
    datagridProperty:{
    	recordDateStart:'创建日期(起)',
    	recordDateEnd:'创建日期(止)'
    },
    datagridPropertySort:{
        id:'默认属性'
    }/*,
    datagridPropertyMultiQuery:{
        enableStateId:'状态'
    }*/
};


function addRiskBlackList() { 
	var rows = $('#list').datagrid('getSelections');
	if(rows.length!=1){
		alert('只能选择一项进行操作');
		return false;
	}
	var riskPayOrderId = rows[0].id;
	
	$('#mydialog').show(); 
	$('#mydialog').dialog({
		modal:true, 
		buttons: [{ 
			text: '提交', 
			iconCls: 'icon-ok', 
			handler: function() { 
				$.ajax({
					type:"POST",
					url:"systemMagAjax_addRiskDeal.action",
					dataType:"json",
					data:{
						'id':riskPayOrderId,
						'dealMethod':$('#dealMethod').val(),
						'dealResult':$('#dealResult').val(),
						'remark':$('#remark').val()
					},
					success:function(msg){
						var msg = eval("("+msg+")"); 
						if(msg.responseCode==0){
							alert(msg.responseContent);
							return;
						}			
						if(confirm('操作成功\r\n是否刷新数据?')){
							reLoadData(); 
							$('#dealMethod').val('');
							$('#dealResult').val('');
							$('#remark').val('');
							$('#mydialog').dialog("close");
						}	
						return;
					},
					error:function(er){
						alert('操作失败：请先确认是否授权访问该资源');
					}
				 });
			} 
		}, { 
			text: '取消', 
			iconCls: 'icon-cancel', 
			handler: function() { 
				$('#mydialog').dialog("close");
			} 
		}] 
	}); 

};

</script>
<style type="text/css">
	.west{
		width: 200px;
		padding: 3px;
		style="overflow-y:auto; 
		overflow-x:hidden;"
	}
	.center{
		padding: 3px;
	}
</style>
</head>

    
<body class="easyui-layout" style="margin: 2px;">
	<div region="west" class="west" title="条件搜索">
        <jsp:include page="../condition.jsp"></jsp:include>
	</div>
	<div region="center" class="center" title="查询列表">
         <table id="list" width="100%" ></table>
	</div>
	
	<!-- 添加对话框 -->
	<div id="mydialog" style="display:none;padding:5px;width:500px; height: 300px" title="风控处理"> 
		<table class="table3" cellpadding="0" cellspacing="0" align="center" width="100%">
			<tr>
				<td>
					<span>处理方法:</span>
					<div>
						<input id="dealMethod" name="dealMethod" size="40" maxlength="20" class="easyui-validatebox" data-options="required:true"/>
					</div>
				</td>
			</tr>
			<tr>
				<td>
					<span>处理结果:</span>
					<div>
						<input id="dealResult" name="dealResult" size="40" maxlength="20" class="easyui-validatebox" data-options="required:true"/>
					</div>
				</td>
			</tr>
			<tr>
				<td>
					<span>备注:</span>
					<div>
						<input id="remark" name="remark" size="40" maxlength="20" class="easyui-validatebox" data-options="required:true"/>
					</div>
				</td>
			</tr>
		</table>
	</div>
</body>
</html>